package nowcoder.day_48.day1;

import java.util.Arrays;
import java.util.Scanner;

/**
 * 组队竞赛
 */
public class Num1 {
    public static void main(String []args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long[] array = new long[3*n];
        for(int i = 0;i < (3*n);i++) {
            array[i] = in.nextLong();
        }
        long count = 0;
        Arrays.sort(array);
        for(int i = 0;i < n;i++){
            count += array[array.length - 2*(i + 1)];
        }
        System.out.println(count);

    }
}
